/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.account.core.repository.mapper;

import info.peigen.hotpot.business.account.core.repository.entity.BankEntity;
import info.peigen.hotpot.common.core.enums.BankCode;
import info.peigen.hotpot.component.data.repository.beetlsql.mapper.AbstractBeetlSqlMapper;
import org.beetl.sql.mapper.annotation.Select;
import org.beetl.sql.mapper.annotation.Sql;
import org.beetl.sql.mapper.annotation.Update;

import java.util.List;

/**
 * <b>(BankMapper)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/12
 */
@SuppressWarnings("AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc")
public interface BankMapper extends AbstractBeetlSqlMapper<BankEntity> {
    @Sql("select * from bank where bank_id = ?")
    @Select
    BankEntity findByBankId(String bankId);

    @Sql("select * from bank where bank_code = ?")
    @Select
    BankEntity findByBankCode(BankCode bankCode);

    @Sql("select * from bank where swift_code = ?")
    @Select
    BankEntity findBySwiftCode(String swiftCode);

    @Sql("select * from bank where abbreviation = ?")
    @Select
    List<BankEntity> findByAbbreviation(String abbreviation);

    @Sql("select * from bank where account_type = ?")
    @Select
    List<BankEntity> findByAccountType(String accountType);

    @Sql("delete from bank where bank_id = ?")
    @Update
    void deleteByBankId(String bankId);
}